package zhoufu.sz.sanxiao_check.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;

import zhoufu.sz.sanxiao_check.R;
import zhoufu.sz.sanxiao_check.inject.HasComponent;
import zhoufu.sz.sanxiao_check.inject.components.DaggerLoginComponet;
import zhoufu.sz.sanxiao_check.inject.components.LoginComponet;
import zhoufu.sz.sanxiao_check.models.CheckItemModel;
import zhoufu.sz.sanxiao_check.ui.basic.BaseMsgActivity;
import zhoufu.sz.sanxiao_check.ui.fragment.FireSafetyFragment;
import zhoufu.sz.sanxiao_check.ui.fragment.ModifyActionFragment;

/**
 * Created by hyc on 16-8-5.
 * 项目 ： XTSanXiao_V2
 * 开发 ： hyc
 * 时间 ： 16-8-5 下午2:46
 * 功能 ：
 */

public class FireSafeActivity extends BaseMsgActivity implements HasComponent<LoginComponet> {
    private LoginComponet loginComponet;

    @Override
    protected void initInject() {
        loginComponet = DaggerLoginComponet.builder().activityModule(getActivityModule())
                .appComponent(getAppComponent()).build();
    }

    @Override
    protected int setIndividualId() {
        return R.layout.layout_frame;
    }

    @Override
    public LoginComponet getComponent() {
        return loginComponet;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        showFragmetn();
    }

    private void showFragmetn() {
        CheckItemModel sid = (CheckItemModel) getIntent().getSerializableExtra("_SID");
        addFragment(R.id.main_fram, ModifyActionFragment.newInstance(sid));
    }
}
